﻿using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using Mammoth.Entities;
using NHibernate;

namespace Mammoth.Repositories
{
    public interface IRepository<T> : IDisposable  where T : Entity
    {
        long Save(Entity entity);
        void Delete(Entity entity);
        IEnumerable<T> Get(Expression<Func<T, bool>> expression = null, int page = 0, int pageWidth = -1);
        T Get(long id);
        long Count(string search = null);
    }
}
